<template>
<div id="app">
  <div class="demo-input-suffix">
    文章标题：
    <el-input
        placeholder="请输入内容"
        v-model="title"
        maxlength=30
        show-word-limit
        style="width: 600px">
    </el-input>
    <el-button type="success" icon="el-icon-check" @click="save" plain></el-button>
  </div>
  <v-md-editor v-model="content"></v-md-editor>
</div>
</template>
<script>
import {defineComponent} from 'vue'
import axios from "axios";

export default defineComponent({
  name: "WriteDocument.vue",
  data(){
    return{
      title:"demo title",
      content: "# demo"
    }
  },
  methods:{
    save(){
      axios.post("/blog/save",{
        title : this.title,
        content:this.content,
        blurb:"临时测试"
      }).then(response =>{
        console.log(response)
      }).catch(error =>{
        console.log(error)
      })
    }
  }
})
</script>

<style scoped>

</style>